home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / ada / gnat1792.zip / gnat179b / t-adainc / interfac.ads < prev    next >
Text File  |  1994-05-19  |  6KB  |  181 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                         GNAT COMPILER COMPONENTS                         --
  4. --                                                                          --
  5. --                           I N T E R F A C E S                            --
  6. --                                                                          --
  7. --                                 S p e c                                  --
  8. --                                                                          --
  9. --                            $Revision: 1.4 $                              --
  10. --                                                                          --
  11. --           Copyright (c) 1992,1993,1994 NYU, All Rights Reserved          --
  12. --                                                                          --
  13. -- GNAT is free software;  you can  redistribute it  and/or modify it under --
  14. -- terms of the  GNU General Public License as published  by the Free Soft- --
  15. -- ware  Foundation;  either version 2,  or (at your option) any later ver- --
  16. -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
  17. -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
  18. -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
  19. -- for  more details.  You should have  received  a copy of the GNU General --
  20. -- Public License  distributed with GNAT;  see file COPYING.  If not, write --
  21. -- to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. --
  22. --                                                                          --
  23. ------------------------------------------------------------------------------
  24.  
  25. --  At the moment there is only one version of this source package available.
  26. --  It assumes integer sizes of 8, 16, 32 and 64 are available, and that the
  27. --  floating-point formats are IEEE compatible. Specialization of this file
  28. --  may be required later if these assumptions are not correct for some target,
  29.  
  30. package Interfaces is
  31.  
  32.    type Integer_8  is range -2 **  7 .. 2 **  7 - 1;
  33.    for Integer_8'Size use  8;
  34.  
  35.    type Integer_16 is range -2 ** 15 .. 2 ** 15 - 1;
  36.    for Integer_16'Size use 16;
  37.  
  38.    type Integer_32 is range -2 ** 31 .. 2 ** 31 - 1;
  39.    for Integer_32'Size use 32;
  40.  
  41.    type Integer_64 is range -2 ** 63 .. 2 ** 63 - 1;
  42.    for Integer_64'Size use 64;
  43.  
  44.    type Unsigned_8  is mod 2 **  8;
  45.    for Unsigned_8'SIze use  8;
  46.  
  47.    type Unsigned_16 is mod 2 ** 16;
  48.    for Unsigned_16'SIze use 16;
  49.  
  50.    type Unsigned_32 is mod 2 ** 32;
  51.    for Unsigned_32'SIze use 32;
  52.  
  53.    type Unsigned_64 is mod 2 ** 64;
  54.    for Unsigned_64'Size use 64;
  55.  
  56.    function Shift_Left
  57.      (Value  : Unsigned_8;
  58.       Amount : Natural)
  59.      return    Unsigned_8;
  60.  
  61.    function Shift_Right
  62.      (Value  : Unsigned_8;
  63.       Amount : Natural)
  64.       return   Unsigned_8;
  65.  
  66.    function Shift_Right_Arithmetic
  67.      (Value  : Unsigned_8;
  68.       Amount : Natural)
  69.       return   Unsigned_8;
  70.  
  71.    function Rotate_Left
  72.      (Value  : Unsigned_8;
  73.       Amount : Natural)
  74.       return   Unsigned_8;
  75.  
  76.    function Rotate_Right
  77.      (Value  : Unsigned_8;
  78.       Amount : Natural)
  79.       return   Unsigned_8;
  80.  
  81.    function Shift_Left
  82.      (Value  : Unsigned_16;
  83.       Amount : Natural)
  84.      return    Unsigned_16;
  85.  
  86.    function Shift_Right
  87.      (Value  : Unsigned_16;
  88.       Amount : Natural)
  89.       return   Unsigned_16;
  90.  
  91.    function Shift_Right_Arithmetic
  92.      (Value  : Unsigned_16;
  93.       Amount : Natural)
  94.       return   Unsigned_16;
  95.  
  96.    function Rotate_Left
  97.      (Value  : Unsigned_16;
  98.       Amount : Natural)
  99.       return   Unsigned_16;
  100.  
  101.    function Rotate_Right
  102.      (Value  : Unsigned_16;
  103.       Amount : Natural)
  104.       return   Unsigned_16;
  105.  
  106.    function Shift_Left
  107.      (Value  : Unsigned_32;
  108.       Amount : Natural)
  109.      return    Unsigned_32;
  110.  
  111.    function Shift_Right
  112.      (Value  : Unsigned_32;
  113.       Amount : Natural)
  114.       return   Unsigned_32;
  115.  
  116.    function Shift_Right_Arithmetic
  117.      (Value  : Unsigned_32;
  118.       Amount : Natural)
  119.       return   Unsigned_32;
  120.  
  121.    function Rotate_Left
  122.      (Value  : Unsigned_32;
  123.       Amount : Natural)
  124.       return   Unsigned_32;
  125.  
  126.    function Rotate_Right
  127.      (Value  : Unsigned_32;
  128.       Amount : Natural)
  129.       return   Unsigned_32;
  130.  
  131.    function Shift_Left
  132.      (Value  : Unsigned_64;
  133.       Amount : Natural)
  134.      return    Unsigned_64;
  135.  
  136.    function Shift_Right
  137.      (Value  : Unsigned_64;
  138.       Amount : Natural)
  139.       return   Unsigned_64;
  140.  
  141.    function Shift_Right_Arithmetic
  142.      (Value  : Unsigned_64;
  143.       Amount : Natural)
  144.       return   Unsigned_64;
  145.  
  146.    function Rotate_Left
  147.      (Value  : Unsigned_64;
  148.       Amount : Natural)
  149.       return   Unsigned_64;
  150.  
  151.    function Rotate_Right
  152.      (Value  : Unsigned_64;
  153.       Amount : Natural)
  154.       return   Unsigned_64;
  155.  
  156.    pragma Convention (Intrinsic, Shift_Left);
  157.    pragma Convention (Intrinsic, Shift_Right);
  158.    pragma Convention (Intrinsic, Shift_Right_Arithmetic);
  159.    pragma Convention (Intrinsic, Rotate_Left);
  160.    pragma Convention (Intrinsic, Rotate_Right);
  161.  
  162.    pragma Import (Intrinsic, Shift_Left);
  163.    pragma Import (Intrinsic, Shift_Right);
  164.    pragma Import (Intrinsic, Shift_Right_Arithmetic);
  165.    pragma Import (Intrinsic, Rotate_Left);
  166.    pragma Import (Intrinsic, Rotate_Right);
  167.  
  168.    --  Floating point types. We assume that we are on an IEEE machine, and
  169.    --  that the types Short_Float and Long_Float in Standard refer to the
  170.    --  32-bit short and 64-bit long IEEE forms. Furthermore, if there is
  171.    --  an extended float, we assume that it is available as Long_Long_Float.
  172.    --  Note: it is harmless, and explicitly permitted, to include additional
  173.    --  types in interfaces, so it is not wrong to have IEEE_Extended_Float
  174.    --  defined even if the extended format is not available.
  175.  
  176.    type IEEE_Short_Float    is new Short_Float;
  177.    type IEEE_Long_Float     is new Long_Float;
  178.    type IEEE_Extended_Float is new Long_Long_Float;
  179.  
  180. end Interfaces;
  181.